.class public Lcom/jecelyin/editor/v2/view/menu/a;
.super Landroid/widget/PopupWindow;
.source "MainPopupMenu.java"


# instance fields
.field private a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

.field private b:Landroidx/recyclerview/widget/RecyclerView;

.field private c:Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

.field private d:Landroid/view/View;

.field e:Z

.field f:Landroid/view/MenuItem$OnMenuItemClickListener;


# direct methods
.method public constructor <init>(Lcom/jecelyin/editor/v2/ui/JeEditorActivity;Landroid/view/View;)V
    .locals 4

    .line 1
    invoke-direct {p0}, Landroid/widget/PopupWindow;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->e:Z

    .line 3
    new-instance v1, Lcom/jecelyin/editor/v2/view/menu/a$a;

    invoke-direct {v1, p0}, Lcom/jecelyin/editor/v2/view/menu/a$a;-><init>(Lcom/jecelyin/editor/v2/view/menu/a;)V

    iput-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->f:Landroid/view/MenuItem$OnMenuItemClickListener;

    .line 4
    iput-object p1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    .line 5
    iput-object p2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->d:Landroid/view/View;

    .line 6
    sget p1, Lcom/jecelyin/editor/v2/j;->je_m_menu:I

    invoke-virtual {p2, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    const/4 p2, 0x1

    if-eqz p1, :cond_0

    .line 7
    iput-object p1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->d:Landroid/view/View;

    .line 8
    iput-boolean p2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->e:Z

    .line 9
    :cond_0
    iget-object p1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p1

    sget v1, Lcom/jecelyin/editor/v2/k;->je_main_popup_menu_layout:I

    const/4 v2, 0x0

    invoke-virtual {p1, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p1

    .line 10
    sget v1, Lcom/jecelyin/editor/v2/j;->popupMenuRecyclerView:I

    invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroidx/recyclerview/widget/RecyclerView;

    iput-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->b:Landroidx/recyclerview/widget/RecyclerView;

    .line 11
    new-instance v2, Landroidx/recyclerview/widget/LinearLayoutManager;

    iget-object v3, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    invoke-direct {v2, v3}, Landroidx/recyclerview/widget/LinearLayoutManager;-><init>(Landroid/content/Context;)V

    invoke-virtual {v1, v2}, Landroidx/recyclerview/widget/RecyclerView;->setLayoutManager(Landroidx/recyclerview/widget/RecyclerView$LayoutManager;)V

    .line 12
    new-instance v1, Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

    iget-object v2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    invoke-direct {v1, v2}, Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->c:Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

    .line 13
    iget-object v2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->b:Landroidx/recyclerview/widget/RecyclerView;

    invoke-virtual {v2, v1}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V

    .line 14
    iget-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->c:Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

    iget-object v2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->f:Landroid/view/MenuItem$OnMenuItemClickListener;

    invoke-virtual {v1, v2}, Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;->a(Landroid/view/MenuItem$OnMenuItemClickListener;)V

    .line 15
    invoke-virtual {p0, p1}, Landroid/widget/PopupWindow;->setContentView(Landroid/view/View;)V

    .line 16
    iget-object p1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    sget v1, Lcom/jecelyin/editor/v2/h;->je_dp_160:I

    invoke-static {p1, v1}, Lcom/jecelyin/editor/v2/utils/h;->a(Landroid/content/Context;I)I

    move-result p1

    invoke-virtual {p0, p1}, Landroid/widget/PopupWindow;->setWidth(I)V

    const/4 p1, -0x2

    .line 17
    invoke-virtual {p0, p1}, Landroid/widget/PopupWindow;->setHeight(I)V

    .line 18
    invoke-virtual {p0, p2}, Landroid/widget/PopupWindow;->setFocusable(Z)V

    .line 19
    invoke-virtual {p0, p2}, Landroid/widget/PopupWindow;->setOutsideTouchable(Z)V

    .line 20
    invoke-virtual {p0}, Landroid/widget/PopupWindow;->update()V

    .line 21
    new-instance p1, Landroid/graphics/drawable/ColorDrawable;

    invoke-direct {p1, v0}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    .line 22
    invoke-virtual {p0, p1}, Landroid/widget/PopupWindow;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 23
    sget p1, Lcom/jecelyin/editor/v2/f;->listPopupWindowStyle:I

    invoke-virtual {p0, p1}, Landroid/widget/PopupWindow;->setAnimationStyle(I)V

    return-void
.end method

.method static synthetic a(Lcom/jecelyin/editor/v2/view/menu/a;)Lcom/jecelyin/editor/v2/ui/JeEditorActivity;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    return-object p0
.end method


# virtual methods
.method public a()Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;
    .locals 1

    .line 2
    iget-object v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->c:Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

    return-object v0
.end method

.method public b()V
    .locals 4

    .line 1
    invoke-virtual {p0}, Landroid/widget/PopupWindow;->isShowing()Z

    move-result v0

    if-nez v0, :cond_2

    .line 2
    iget-boolean v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->e:Z

    if-eqz v0, :cond_0

    .line 3
    iget-object v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->d:Landroid/view/View;

    iget-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    invoke-static {v1}, Lcom/jecelyin/editor/v2/utils/h;->a(Landroid/content/Context;)I

    move-result v1

    invoke-virtual {p0}, Landroid/widget/PopupWindow;->getWidth()I

    move-result v2

    sub-int/2addr v1, v2

    const/4 v2, 0x0

    invoke-virtual {p0, v0, v1, v2}, Lcom/jecelyin/editor/v2/view/menu/a;->showAsDropDown(Landroid/view/View;II)V

    goto :goto_0

    .line 4
    :cond_0
    iget-object v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->d:Landroid/view/View;

    iget-object v1, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    invoke-static {v1}, Lcom/jecelyin/editor/v2/utils/h;->a(Landroid/content/Context;)I

    move-result v1

    invoke-virtual {p0}, Landroid/widget/PopupWindow;->getWidth()I

    move-result v2

    sub-int/2addr v1, v2

    iget-object v2, p0, Lcom/jecelyin/editor/v2/view/menu/a;->a:Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    sget v3, Lcom/jecelyin/editor/v2/h;->je_dp_20:I

    .line 5
    invoke-static {v2, v3}, Lcom/jecelyin/editor/v2/utils/h;->a(Landroid/content/Context;I)I

    move-result v2

    neg-int v2, v2

    .line 6
    invoke-virtual {p0, v0, v1, v2}, Lcom/jecelyin/editor/v2/view/menu/a;->showAsDropDown(Landroid/view/View;II)V

    .line 7
    :goto_0
    iget-object v0, p0, Lcom/jecelyin/editor/v2/view/menu/a;->c:Lcom/jecelyin/editor/v2/adapter/MainMenuAdapter;

    if-eqz v0, :cond_1

    .line 8
    invoke-virtual {v0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V

    :cond_1
    const-string v0, ""

    const-string v1, "shw"

    const-string v2, "thm"

    .line 9
    invoke-static {v2, v1, v0}, Lcom/jecelyin/editor/v2/a;->b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    const-string v2, "hlm"

    .line 10
    invoke-static {v2, v1, v0}, Lcom/jecelyin/editor/v2/a;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 11
    :cond_2
    invoke-virtual {p0}, Landroid/widget/PopupWindow;->dismiss()V

    :goto_1
    return-void
.end method

.method public showAsDropDown(Landroid/view/View;II)V
    .locals 0

    .line 1
    invoke-super {p0, p1, p2, p3}, Landroid/widget/PopupWindow;->showAsDropDown(Landroid/view/View;II)V

    return-void
.end method
